#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#

Import('EqlIfEnv')

env = EqlIfEnv.Clone()

env.Append(CPPPATH = env['TOP'])
env.Append(CPPPATH = [env['TOP'] + '/database'])

def MapBuildDir(list):
    return map(lambda x: env['TOP'] + '/' + x, list)

env.Prepend(LIBS=[  'io',
                    'sandesh',
                    'http',
                    'http_parser',
                    'pugixml',
                    'xml',
                    'curl',
                    'sandeshvns',
                    'process_info',
                    'io',
                    'base',
                    'ssl',
                    'crypto',
                    'gunit',
                    'etcdql',
                    'protobuf',
                    'grpc++',
                    'grpc',
                    'z' ])

libs = MapBuildDir([
        'xml',
        'base',
        'io',
        'sandesh'])

env.Append(LIBPATH=libs)

env.Prepend(LINKFLAGS=['-Wl,--whole-archive', '-lbase','-Wl,--no-whole-archive' ])

eql_if_test = env.UnitTest('eql_if_test',
                          ['eql_if_test.cc'])

test_suite = []
test = env.TestSuite('eqlif_test_suite', test_suite)
def_env = DefaultEnvironment()
env.Alias('src/contrail-common/database/etcd/eql:test', test)

flaky_test_suite = [ eql_if_test ]
flaky_test = env.TestSuite('eqlif_flaky_test_suite', flaky_test_suite)
env.Alias('src/contrail-common/database/etcd/eql:flaky-test', flaky_test)
